import pandas as pd
filepath = "C:\\Users\\abdelilah\\Desktop\\Python Projects\\Udemy Courses\\"
udemy_df = pd.read_csv(filepath + "Udemy Courses.csv", delimiter = ",")
udemy_df
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 288942 | #1 Piano Hand Coordination: Play 10th Ballad i... | True | 35 | 3137 | 18 | 68 | All Levels | 1.5 hours | 2014-09-18T05:07:05Z | Musical Instruments |
1 | 1170074 | #10 Hand Coordination - Transfer Chord Ballad ... | True | 75 | 1593 | 1 | 41 | Intermediate Level | 1 hour | 2017-04-12T19:06:34Z | Musical Instruments |
2 | 1193886 | #12 Hand Coordination: Let your Hands dance wi... | True | 75 | 482 | 1 | 47 | Intermediate Level | 1.5 hours | 2017-04-26T18:34:57Z | Musical Instruments |
3 | 1116700 | #4 Piano Hand Coordination: Fun Piano Runs in ... | True | 75 | 850 | 3 | 43 | Intermediate Level | 1 hour | 2017-02-21T23:48:18Z | Musical Instruments |
4 | 1120410 | #5 Piano Hand Coordination: Piano Runs in 2 ... | True | 75 | 940 | 3 | 32 | Intermediate Level | 37 mins | 2017-02-21T23:44:49Z | Musical Instruments |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
3677 | 328960 | Your Own Site in 45 Min: The Complete Wordpres... | True | 120 | 1566 | 29 | 36 | All Levels | 4 hours | 2015-04-20T22:15:17Z | Web Development |
3678 | 552700 | Your Second Course on Piano: Two Handed Playing | True | 70 | 1018 | 12 | 22 | Beginner Level | 5 hours | 2015-10-26T20:04:21Z | Musical Instruments |
3679 | 631754 | Zend Framework 2: Learn the PHP framework ZF2 ... | True | 40 | 723 | 130 | 37 | All Levels | 6.5 hours | 2015-11-11T18:55:45Z | Web Development |
3680 | 1225194 | Zoho Books Gestion Financière d'Entreprise pas... | False | Free | 229 | 0 | 33 | All Levels | 2 hours | 2017-05-26T16:45:55Z | Business Finance |
3681 | 964478 | Zombie Apocalypse Photoshop Actions | True | 50 | 12 | 1 | 15 | All Levels | 1.5 hours | 2016-09-26T22:19:48Z | Graphic Design |
3682 rows × 11 columns
udemy_df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 3682 entries, 0 to 3681 Data columns (total 11 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 course_id 3682 non-null int64 1 course_title 3682 non-null object 2 is_paid 3682 non-null bool 3 price 3682 non-null object 4 num_subscribers 3682 non-null int64 5 num_reviews 3682 non-null int64 6 num_lectures 3682 non-null int64 7 level 3682 non-null object 8 content_duration 3682 non-null object 9 published_timestamp 3682 non-null object 10 subject 3682 non-null object dtypes: bool(1), int64(4), object(6) memory usage: 291.4+ KB
First Task: What are all different subjects for which Udemy is offering courses ?
subj = udemy_df.subject.value_counts().index.tolist()
subj
['Web Development', 'Business Finance', 'Musical Instruments', 'Graphic Design']
Second Task: Which subject has the maximum number of courses.
udemy_df.subject.value_counts().max()
1200
sub = pd.DataFrame(udemy_df.subject.value_counts())
sub
subject | |
---|---|
Web Development | 1200 |
Business Finance | 1199 |
Musical Instruments | 680 |
Graphic Design | 603 |
sub.idxmax()
subject Web Development dtype: object
# Web Development is the subject with most courses on Udemy
Third Task: Show all the courses which are Free of Cost.
udemy_df[udemy_df["price"] == "Free"]
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
41 | 286070 | 5 lecciones que todo guitarrista debe tomar | False | Free | 4452 | 263 | 14 | Beginner Level | 1 hour | 2014-08-23T05:08:14Z | Musical Instruments |
49 | 696630 | 7 Ways A Beginner Guitarist Can Sound Better, ... | False | Free | 4529 | 193 | 7 | Beginner Level | 36 mins | 2015-12-21T18:50:50Z | Musical Instruments |
57 | 955914 | A beginner`s guide to fingerpicking and strumm... | False | Free | 3481 | 29 | 20 | Beginner Level | 2 hours | 2016-09-13T21:51:59Z | Musical Instruments |
67 | 270976 | A how to guide in HTML | False | Free | 7318 | 205 | 8 | Beginner Level | 35 mins | 2014-08-10T20:19:10Z | Web Development |
74 | 1214144 | ¡Triunfar en La Bolsa de Valores No Requiere d... | False | Free | 338 | 7 | 6 | Beginner Level | 1 hour | 2017-05-30T14:30:12Z | Business Finance |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
3620 | 552598 | WordPress in under an hour - Create/manage you... | False | Free | 6474 | 86 | 15 | All Levels | 1 hour | 2015-07-15T00:21:56Z | Web Development |
3638 | 1068590 | Wordpress Website Mastery 2017 | False | Free | 5181 | 64 | 22 | Beginner Level | 2.5 hours | 2017-01-18T17:01:40Z | Web Development |
3652 | 752706 | Write quicker HTML5 and CSS 3; productivity ha... | False | Free | 13016 | 286 | 15 | All Levels | 1.5 hours | 2016-03-03T17:45:31Z | Web Development |
3674 | 1257976 | Your First 10 Guitar Lessons - Learn how to pl... | False | Free | 924 | 4 | 18 | Beginner Level | 1 hour | 2017-06-29T00:29:36Z | Musical Instruments |
3680 | 1225194 | Zoho Books Gestion Financière d'Entreprise pas... | False | Free | 229 | 0 | 33 | All Levels | 2 hours | 2017-05-26T16:45:55Z | Business Finance |
310 rows × 11 columns
Fourth Task: Show all the courses which are Paid.
udemy_df[udemy_df["price"] != "Free"]
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 288942 | #1 Piano Hand Coordination: Play 10th Ballad i... | True | 35 | 3137 | 18 | 68 | All Levels | 1.5 hours | 2014-09-18T05:07:05Z | Musical Instruments |
1 | 1170074 | #10 Hand Coordination - Transfer Chord Ballad ... | True | 75 | 1593 | 1 | 41 | Intermediate Level | 1 hour | 2017-04-12T19:06:34Z | Musical Instruments |
2 | 1193886 | #12 Hand Coordination: Let your Hands dance wi... | True | 75 | 482 | 1 | 47 | Intermediate Level | 1.5 hours | 2017-04-26T18:34:57Z | Musical Instruments |
3 | 1116700 | #4 Piano Hand Coordination: Fun Piano Runs in ... | True | 75 | 850 | 3 | 43 | Intermediate Level | 1 hour | 2017-02-21T23:48:18Z | Musical Instruments |
4 | 1120410 | #5 Piano Hand Coordination: Piano Runs in 2 ... | True | 75 | 940 | 3 | 32 | Intermediate Level | 37 mins | 2017-02-21T23:44:49Z | Musical Instruments |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
3676 | 498488 | Your First Successful Forex Trades - With Case... | True | 200 | 1079 | 34 | 16 | All Levels | 2.5 hours | 2015-05-26T20:48:48Z | Business Finance |
3677 | 328960 | Your Own Site in 45 Min: The Complete Wordpres... | True | 120 | 1566 | 29 | 36 | All Levels | 4 hours | 2015-04-20T22:15:17Z | Web Development |
3678 | 552700 | Your Second Course on Piano: Two Handed Playing | True | 70 | 1018 | 12 | 22 | Beginner Level | 5 hours | 2015-10-26T20:04:21Z | Musical Instruments |
3679 | 631754 | Zend Framework 2: Learn the PHP framework ZF2 ... | True | 40 | 723 | 130 | 37 | All Levels | 6.5 hours | 2015-11-11T18:55:45Z | Web Development |
3681 | 964478 | Zombie Apocalypse Photoshop Actions | True | 50 | 12 | 1 | 15 | All Levels | 1.5 hours | 2016-09-26T22:19:48Z | Graphic Design |
3372 rows × 11 columns
Fifth Task: Which are Top Selling Courses ?
# the only column that we can rely on to know the top selling courses is "num_subscribers" which shows how many people are
# subscribed to that course, but this gives us info about the present count of users not the history of how many people used it
udemy_df.sort_values("num_subscribers", ascending = False).head(10)
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
2230 | 41295 | Learn HTML5 Programming From Scratch | False | Free | 268923 | 8629 | 45 | All Levels | 10.5 hours | 2013-02-14T07:03:41Z | Web Development |
776 | 59014 | Coding for Entrepreneurs Basic | False | Free | 161029 | 279 | 27 | Beginner Level | 3.5 hours | 2013-06-09T15:51:55Z | Web Development |
3385 | 625204 | The Web Developer Bootcamp | True | 200 | 121584 | 27445 | 342 | All Levels | 43 hours | 2015-11-02T21:13:27Z | Web Development |
640 | 173548 | Build Your First Website in 1 Week with HTML5 ... | False | Free | 120291 | 5924 | 30 | Beginner Level | 3 hours | 2014-04-08T16:21:30Z | Web Development |
3316 | 764164 | The Complete Web Developer Course 2.0 | True | 200 | 114512 | 22412 | 304 | All Levels | 30.5 hours | 2016-03-08T22:28:36Z | Web Development |
1388 | 19421 | Free Beginner Electric Guitar Lessons | False | Free | 101154 | 1042 | 95 | Beginner Level | 4.5 hours | 2012-06-15T17:00:33Z | Musical Instruments |
3556 | 473160 | Web Design for Web Developers: Build Beautiful... | False | Free | 98867 | 6512 | 20 | All Levels | 3 hours | 2015-04-13T18:29:47Z | Web Development |
2233 | 94430 | Learn Javascript & JQuery From Scratch | True | 30 | 84897 | 2685 | 10 | All Levels | 2 hours | 2013-10-10T15:19:29Z | Web Development |
2886 | 130064 | Practical PHP: Master the Basics and Code Dyna... | False | Free | 83737 | 4598 | 45 | All Levels | 6.5 hours | 2014-07-19T03:02:05Z | Web Development |
2034 | 364426 | JavaScript: Understanding the Weird Parts | True | 175 | 79612 | 16976 | 85 | All Levels | 11.5 hours | 2015-03-12T23:19:54Z | Web Development |
Sixth Task: Which are Least Selling Courses ?
udemy_df.sort_values("num_subscribers", ascending = True).head(20)
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
649 | 1233314 | Building a Balanced Scorecard | True | 50 | 0 | 0 | 11 | Intermediate Level | 2 hours | 2017-07-03T21:38:22Z | Business Finance |
3259 | 1232282 | The Cash Flow Statement - An Introduction | True | 50 | 0 | 0 | 10 | Beginner Level | 1.5 hours | 2017-06-28T16:05:51Z | Business Finance |
3261 | 1275872 | The Complete Adobe Spark Course | True | 150 | 0 | 0 | 29 | All Levels | 2 hours | 2017-07-03T17:39:57Z | Graphic Design |
910 | 726314 | Create Beautiful Image Maps for Your Website | True | 20 | 0 | 0 | 8 | Intermediate Level | 37 mins | 2016-01-18T17:56:36Z | Graphic Design |
3328 | 715476 | The Cuckoo Strategy to get European Funding | True | 160 | 0 | 0 | 6 | All Levels | 1 hour | 2016-01-06T02:38:23Z | Business Finance |
1325 | 1187084 | Forex how traders beat the markest with little... | True | 100 | 0 | 0 | 16 | All Levels | 1 hour | 2017-07-06T21:16:13Z | Business Finance |
2596 | 185526 | MicroStation - Células | True | 20 | 0 | 0 | 9 | Beginner Level | 37 mins | 2014-04-15T21:48:55Z | Graphic Design |
2597 | 185526 | MicroStation - Células | True | 20 | 0 | 0 | 9 | Beginner Level | 37 mins | 2014-04-15T21:48:55Z | Graphic Design |
848 | 1232390 | Corporate Ethics | True | 100 | 0 | 0 | 13 | Beginner Level | 3.5 hours | 2017-07-03T21:39:13Z | Business Finance |
2900 | 995384 | Professional Business Logo Design Using Free O... | True | 20 | 0 | 0 | 5 | All Levels | 37 mins | 2016-10-31T16:09:48Z | Graphic Design |
2635 | 627332 | Mutual Funds for Investors in Retirement Accounts | True | 20 | 0 | 0 | 0 | All Levels | 0 | 2015-12-17T05:38:38Z | Business Finance |
840 | 1232312 | Core Financial Statement Concepts | True | 50 | 0 | 0 | 9 | Intermediate Level | 1.5 hours | 2017-06-28T21:58:15Z | Business Finance |
2350 | 371900 | Learn to create Text fire effect in Adobe Phot... | True | 20 | 0 | 0 | 8 | All Levels | 36 mins | 2014-12-19T23:19:47Z | Graphic Design |
44 | 1231958 | 60 Minutes to Fundamental Accounting Skills | True | 75 | 0 | 0 | 9 | Beginner Level | 2.5 hours | 2017-06-28T21:55:29Z | Business Finance |
1931 | 1247992 | Introduction to Project Management for Finance... | True | 50 | 0 | 0 | 9 | Beginner Level | 2 hours | 2017-07-03T21:40:32Z | Business Finance |
1910 | 1157298 | Introduction to Forex Trading Business For Beg... | True | 20 | 0 | 0 | 27 | Beginner Level | 1.5 hours | 2017-04-23T16:19:01Z | Business Finance |
1561 | 975910 | How to achieve personal transformation | True | 20 | 0 | 0 | 10 | All Levels | 32 mins | 2016-12-22T00:28:07Z | Business Finance |
2983 | 1233302 | Ratio Analysis for Financial Statements | True | 50 | 0 | 0 | 6 | Beginner Level | 2 hours | 2017-07-03T21:39:57Z | Business Finance |
2070 | 1215926 | Kickstarter success in 5 easy steps | True | 20 | 0 | 0 | 12 | All Levels | 31 mins | 2017-05-16T14:55:28Z | Business Finance |
3246 | 1133764 | The Art of Logo Design : Everything You Need t... | True | 20 | 0 | 0 | 18 | All Levels | 1 hour | 2017-03-09T16:11:36Z | Graphic Design |
Seventh Task: Show all courses of Graphic Design where the price is below 100 ?
# i have to get rid of "Free" from the price column as i can't perform a comparasion between integers while having a string
# and then i must change the type of that column from "object" to "int"
udemy_df["price"] = udemy_df["price"].replace("Free", 0)
udemy_df["price"] = pd.to_numeric(udemy_df["price"])
udemy_df.dtypes
course_id int64 course_title object is_paid bool price int64 num_subscribers int64 num_reviews int64 num_lectures int64 level object content_duration object published_timestamp datetime64[ns, UTC] subject object dtype: object
udemy_df[(udemy_df["subject"] == "Graphic Design") & (udemy_df["price"] < 100)]
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
8 | 206592 | :::Beginners Guide To Creating Amazing Images ... | True | 25 | 72 | 5 | 17 | Beginner Level | 1 hour | 2014-04-29T19:50:31Z | Graphic Design |
20 | 1165268 | 15 Motion Graphic Elements in After Effect (S... | True | 30 | 8 | 0 | 20 | Intermediate Level | 3 hours | 2017-04-11T04:27:34Z | Graphic Design |
35 | 1164876 | 3DS MAX - Learn 3Ds MAX tutorial for Beginners... | True | 20 | 785 | 2 | 29 | All Levels | 4.5 hours | 2017-04-18T16:45:59Z | Graphic Design |
39 | 599652 | 48 Logo Designs and Techniques | True | 20 | 113 | 9 | 48 | All Levels | 9 hours | 2015-09-15T00:23:14Z | Graphic Design |
52 | 794036 | 8 Stunden professionelles Cinema 4D Training | True | 50 | 18 | 1 | 38 | All Levels | 8.5 hours | 2016-03-22T20:51:28Z | Graphic Design |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
3568 | 133968 | Web Elements Design With Photoshop | True | 45 | 5072 | 38 | 44 | All Levels | 5 hours | 2014-10-21T19:18:12Z | Graphic Design |
3588 | 1131780 | Whiteboard Animation, Beginner To Expert - In ... | True | 20 | 1343 | 25 | 16 | All Levels | 1 hour | 2017-03-14T20:52:30Z | Graphic Design |
3639 | 1122306 | Wordpress: Comment utiliser le thème FABLE | True | 20 | 1 | 0 | 10 | Beginner Level | 39 mins | 2017-03-07T16:53:27Z | Graphic Design |
3671 | 144222 | YOU can Draw, Shade and Paint a Mixed Media Gi... | True | 30 | 1249 | 44 | 19 | Beginner Level | 3 hours | 2014-01-28T02:30:26Z | Graphic Design |
3681 | 964478 | Zombie Apocalypse Photoshop Actions | True | 50 | 12 | 1 | 15 | All Levels | 1.5 hours | 2016-09-26T22:19:48Z | Graphic Design |
485 rows × 11 columns
Eight Task: List out all the courses that are related to 'Python'.
df_pyth = udemy_df.loc[udemy_df["course_title"].str.contains("Python") == True]
df_pyth
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | |
---|---|---|---|---|---|---|---|---|---|---|---|
216 | 599504 | Advanced Scalable Python Web Development Using... | True | 120 | 1299 | 56 | 71 | Intermediate Level | 14 hours | 2016-08-11T22:09:24Z | Web Development |
777 | 47963 | Coding for Entrepreneurs: Learn Python, Django... | True | 195 | 23412 | 799 | 251 | All Levels | 45 hours | 2013-04-08T00:46:14Z | Web Development |
814 | 631128 | Complete Python Web Course: Build 8 Python Web... | True | 110 | 7489 | 941 | 173 | All Levels | 16 hours | 2015-11-08T20:57:35Z | Web Development |
842 | 186096 | Core: A Web App Reference Guide for Django, Py... | True | 195 | 2497 | 98 | 154 | All Levels | 26 hours | 2014-05-29T00:58:43Z | Web Development |
1400 | 394832 | Fun and creative web engineering with Python a... | False | 0 | 10917 | 319 | 25 | All Levels | 2 hours | 2015-06-09T19:51:50Z | Web Development |
1932 | 1038538 | Introduction to QGIS Python Programming | True | 85 | 197 | 26 | 28 | Beginner Level | 3.5 hours | 2016-12-22T00:11:22Z | Web Development |
1969 | 902888 | Investment Portfolio Analysis with Python | True | 50 | 209 | 13 | 37 | All Levels | 7 hours | 2016-07-13T21:40:32Z | Business Finance |
2294 | 391546 | Learn Python and Django: Payment Processing | True | 70 | 17714 | 198 | 23 | All Levels | 3.5 hours | 2015-02-09T15:37:56Z | Web Development |
2295 | 1063722 | Learn Python Django - A Hands-On Course | True | 50 | 1339 | 21 | 18 | Beginner Level | 2 hours | 2017-01-18T21:53:34Z | Web Development |
2341 | 546848 | Learn to code in Python and learn Adobe Photos... | True | 50 | 1132 | 1 | 29 | All Levels | 2 hours | 2015-07-08T00:15:12Z | Graphic Design |
2906 | 368340 | Professional Python Web Development Using Flask | True | 120 | 3420 | 489 | 102 | Beginner Level | 14.5 hours | 2015-03-04T00:10:36Z | Web Development |
2908 | 1035940 | Professional RESTful API Design using Python F... | True | 120 | 578 | 25 | 36 | Intermediate Level | 4.5 hours | 2017-01-11T21:15:25Z | Web Development |
2929 | 270808 | Projects in Django and Python | True | 60 | 1764 | 53 | 28 | All Levels | 6.5 hours | 2014-10-21T07:58:07Z | Web Development |
2952 | 1170894 | Python Algo Stock Trading: Automate Your Trading! | True | 95 | 1165 | 21 | 41 | Beginner Level | 2.5 hours | 2017-05-28T23:41:03Z | Business Finance |
2953 | 1070886 | Python Algo Trading: FX Trading with Oanda | True | 200 | 453 | 42 | 33 | Intermediate Level | 3 hours | 2017-03-14T00:39:45Z | Business Finance |
2954 | 1196544 | Python Algo Trading: Sentiment Trading with News | True | 200 | 294 | 19 | 42 | All Levels | 7 hours | 2017-04-28T16:41:44Z | Business Finance |
2955 | 822444 | Python and Django Full Stack Web Developer Boo... | True | 200 | 11832 | 1883 | 191 | All Levels | 31.5 hours | 2017-02-24T18:40:55Z | Web Development |
2956 | 477702 | Python for Beginners: Python Programming Langu... | True | 150 | 6153 | 125 | 84 | Beginner Level | 5 hours | 2015-06-14T18:18:57Z | Web Development |
2957 | 1035472 | Python for Finance: Investment Fundamentals & ... | True | 195 | 3811 | 278 | 103 | All Levels | 6.5 hours | 2017-03-30T22:17:09Z | Business Finance |
2958 | 529828 | Python for Trading & Investing | True | 95 | 638 | 25 | 36 | All Levels | 5 hours | 2015-06-17T22:23:31Z | Business Finance |
2959 | 70640 | Python Programming: Create an Digital Marketpl... | True | 195 | 4198 | 145 | 161 | All Levels | 26 hours | 2013-10-20T19:53:28Z | Web Development |
2960 | 523312 | Python Web Programming | True | 100 | 1020 | 46 | 60 | Beginner Level | 6 hours | 2015-07-01T21:46:36Z | Web Development |
2962 | 1088656 | Quantitative Trading Analysis with Python | True | 50 | 256 | 17 | 49 | All Levels | 5.5 hours | 2017-01-27T17:11:28Z | Business Finance |
3013 | 970600 | REST APIs with Flask and Python | True | 110 | 5151 | 737 | 115 | Intermediate Level | 12.5 hours | 2016-11-06T19:00:38Z | Web Development |
3154 | 815482 | Stock Technical Analysis with Python | True | 50 | 409 | 35 | 46 | All Levels | 8 hours | 2016-04-12T00:40:03Z | Business Finance |
3272 | 938560 | The Complete Ethical Hacking Course 2.0: Pytho... | True | 195 | 7827 | 268 | 66 | All Levels | 11 hours | 2016-09-26T15:08:29Z | Web Development |
3460 | 76052 | Try Django 1.9 | Build a Blog and Learn Python... | True | 50 | 7407 | 172 | 147 | All Levels | 20 hours | 2014-03-04T07:12:21Z | Web Development |
3573 | 16646 | Web Programming with Python | True | 50 | 35267 | 217 | 53 | All Levels | 4 hours | 2012-04-25T00:01:43Z | Web Development |
3574 | 574082 | Web Scraping with Python, Ruby & import. io | True | 75 | 973 | 50 | 46 | All Levels | 4.5 hours | 2015-08-09T22:16:41Z | Web Development |
Ninth Task: What are courses that were published in the year 2015 ?
udemy_df["published_timestamp"] = pd.to_datetime(udemy_df["published_timestamp"])
udemy_df["year"] = ""
udemy_df["year"] = pd.DatetimeIndex(udemy_df["published_timestamp"]).year
udemy_df[udemy_df.year == 2015]
course_id | course_title | is_paid | price | num_subscribers | num_reviews | num_lectures | level | content_duration | published_timestamp | subject | year | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | 591880 | 1 - Concepts of Statistics For Beginners Step ... | True | 200 | 273 | 4 | 15 | Beginner Level | 31 mins | 2015-08-30 22:48:34+00:00 | Business Finance | 2015 |
16 | 302450 | 10 Numbers Every Business Owner Should Know | True | 20 | 13 | 1 | 9 | All Levels | 1 hour | 2015-03-08 19:11:24+00:00 | Business Finance | 2015 |
19 | 384928 | 101 Blues riffs - learn how the harmonica supe... | True | 200 | 1350 | 65 | 55 | Intermediate Level | 6.5 hours | 2015-01-04 21:14:31+00:00 | Musical Instruments | 2015 |
23 | 550842 | 16 Guitar Chords to Jam With - (Beginner - Int... | True | 20 | 1224 | 19 | 20 | Beginner Level | 1 hour | 2015-07-10 19:53:56+00:00 | Musical Instruments | 2015 |
26 | 486240 | 2 Easy Steps To Investment And Avoiding Traps | True | 20 | 828 | 1 | 20 | All Levels | 1 hour | 2015-04-27 23:18:59+00:00 | Business Finance | 2015 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
3675 | 551170 | Your First Course on Piano | True | 70 | 2002 | 34 | 33 | Beginner Level | 4 hours | 2015-07-16 17:07:49+00:00 | Musical Instruments | 2015 |
3676 | 498488 | Your First Successful Forex Trades - With Case... | True | 200 | 1079 | 34 | 16 | All Levels | 2.5 hours | 2015-05-26 20:48:48+00:00 | Business Finance | 2015 |
3677 | 328960 | Your Own Site in 45 Min: The Complete Wordpres... | True | 120 | 1566 | 29 | 36 | All Levels | 4 hours | 2015-04-20 22:15:17+00:00 | Web Development | 2015 |
3678 | 552700 | Your Second Course on Piano: Two Handed Playing | True | 70 | 1018 | 12 | 22 | Beginner Level | 5 hours | 2015-10-26 20:04:21+00:00 | Musical Instruments | 2015 |
3679 | 631754 | Zend Framework 2: Learn the PHP framework ZF2 ... | True | 40 | 723 | 130 | 37 | All Levels | 6.5 hours | 2015-11-11 18:55:45+00:00 | Web Development | 2015 |
1014 rows × 12 columns
Tenth Task: What is the Max. Number of Subscribers for Each Level of courses ?
levels = udemy_df.level.unique()
levels
array(['All Levels', 'Intermediate Level', 'Beginner Level', 'Expert Level'], dtype=object)
max_df = pd.DataFrame(columns = ["level", "max subs"])
max_df["level"] = levels
max_df = max_df.set_index("level")
for l in levels:
max_df.loc[l, "max subs"] = udemy_df[udemy_df.level == l]["num_subscribers"].max()
max_df
max subs | |
---|---|
level | |
All Levels | 268923 |
Intermediate Level | 29167 |
Beginner Level | 161029 |
Expert Level | 5172 |